跳到主要内容

STDEVP

Calculates standard deviation based on the entire population given as arguments (ignores logical values and text).

Syntax

expression.STDEVP(args);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
argsRequirednumber[]numberApiName

Returns

number

Example

const oWorksheet = Api.GetActiveSheet();

var valueArr = [1, 0, 0, 0, 4, 1, 0, 0, 2, 3, 6, 7, 6, 8, 10, 12];

// Place the numbers in cells
for (var i = 0; i < valueArr.length; i++) {
oWorksheet.GetRange("A" + (i + 1)).SetValue(valueArr[i]);
}

var oFunction = Api.GetWorksheetFunction();
var ans = oFunction.STDEVP(1, 0, 0, 0, 4, 1, 0, 0, 2, 3, 6, 7, 6, 8, 10, 12);

oWorksheet.GetRange("C1").SetValue(ans);